package com.vains.db.util;

import freemarker.template.Template;
import freemarker.template.TemplateException;

import java.io.IOException;
import java.io.StringWriter;

/**
 * Freemarker帮助类
 *
 * @author vains
 * @version 1.0
 * @since 2020/6/20 0:18
 **/
public class FreeMarkerTemplateUtils {

    public static String processTemplateIntoString(Template template, Object model) throws IOException, TemplateException {
        StringWriter result = new StringWriter();
        template.process(model, result);
        return result.toString();
    }

}
